package com.skj.server;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;
import com.google.appengine.api.datastore.* ;

import javax.jdo.annotations.* ;

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true")
public class Resource
{
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;

	@Persistent
    private String location;
	
    @Persistent
    private String mimeType;
    
    @Persistent
    private Blob content;
    
    public Resource(String location, String mimeType, Blob content)
    {
    	key = KeyFactory.createKey("Resource", location) ;
    	
    	this.location 	= location ;
        this.mimeType 	= mimeType ;
        this.content 	= content ;
    }
    
    public String getLocation()
    {
    	return this.location ;
    }
    
    public String getMimeType()
    {
    	return this.mimeType ;
    }
    
    public Blob getContent()
    {
    	return this.content ;
    }
    
    public void setLocation(String location)
    {
    	this.location 	= location ;
    }
    
    public void setMimeType(String mimeType)
    {
    	this.mimeType 	= mimeType ;
    }
    
    public void setContent(Blob content)
    {
    	this.content 	= content ;
    }
}
